/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

import BLL.BLLProduct;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

/**
 *
 * @author Pham
 */
public class DTOImport {
    int importID;
    Date importDate;
    int importQuantity;
    long importPrice;
    DTOProduct dtoPro;
    
    //accessors
    public int getImportID() {
        return importID;
    }

    public void setImportID(int importID) {
        this.importID = importID;
    }

    public Date getImportDate() {
        return importDate;
    }

    public void setImportDate(Date importDate) {
        this.importDate = importDate;
    }

    public int getImportQuantity() {
        return importQuantity;
    }

    public void setImportQuantity(int importQuantity) {
        this.importQuantity = importQuantity;
    }

    public long getImportPrice() {
        return importPrice;
    }

    public void setImportPrice(long importPrice) {
        this.importPrice = importPrice;
    }

    public DTOProduct getDtoPro() {
        return dtoPro;
    }

    public void setDtoPro(DTOProduct dtoPro) {
        this.dtoPro = dtoPro;
    }
    
    
    //public contructor
    public DTOImport()
    {
        
    }
    
    public DTOImport(ResultSet rs) throws SQLException
    {
        this.importID = rs.getInt("import_id");
        this.importQuantity = rs.getInt("import_quantity");
        this.importPrice = rs.getLong("import_price");
        this.importDate = rs.getDate("import_date");
        this.dtoPro = (new BLLProduct().getProductbyID(rs.getInt("product_id")));
    }
}
